<?php

namespace App\Console\Commands;

use App\Lead;
use Illuminate\Console\Command;

class XunkeCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'xunke {user_id}';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
      $leads=  Lead::where('project_id',58)
            ->where('owner_user_id',8)
            ->take(20)
            ->get();
      foreach ($leads as $lead){
          $lead->owner_user_id=$this->argument('user_id');
          $lead->save();
      }
    }
}
